<?php

class Kal_Banners_Block_Manage_Comment_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
{
  protected function _prepareForm()
  {
      $form = new Varien_Data_Form(array(
                                      'id' => 'edit_form',
                                      'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
                                      'method' => 'post',
                                   ));
	  $form->setUseContainer(true);
      $this->setForm($form);
	  
      $fieldset = $form->addFieldset('comment_form', array('legend'=>Mage::helper('banners')->__('Comment Information')));
     
      $fieldset->addField('user', 'text', array(
          'label'     => Mage::helper('banners')->__('User'),
          'name'      => 'user',
      ));
	  
	  $fieldset->addField('email', 'text', array(
          'label'     => Mage::helper('banners')->__('Email Address'),
          'name'      => 'email',
      ));

      $fieldset->addField('status', 'select', array(
          'label'     => Mage::helper('banners')->__('Status'),
          'name'      => 'status',
          'values'    => array(
              array(
                  'value'     => 1,
                  'label'     => Mage::helper('banners')->__('Unapproved'),
              ),

              array(
                  'value'     => 2,
                  'label'     => Mage::helper('banners')->__('Approved'),
              ),
          ),
      ));
     
      $fieldset->addField('comment', 'editor', array(
          'name'      => 'comment',
          'label'     => Mage::helper('banners')->__('Comment'),
          'title'     => Mage::helper('banners')->__('Comment'),
          'style'     => 'width:700px; height:500px;',
          'wysiwyg'   => false,
          'required'  => false,
      ));
     
      if ( Mage::getSingleton('adminhtml/session')->getBannersData() )
      {
          $form->setValues(Mage::getSingleton('adminhtml/session')->getBannersData());
          Mage::getSingleton('adminhtml/session')->setBannersData(null);
      } elseif ( Mage::registry('banners_data') ) {
          $form->setValues(Mage::registry('banners_data')->getData());
      }
      return parent::_prepareForm();
  }
}